Deploying a community image, Azure Data Science Core

Once you have a virtual machine image registered on your storage account, deploying the image is simple.
Let's see how it works in Simple Azure.

Load Simple Azure

Don't forget to load simple azure first.


In [15]:
from simpleazure import SimpleAzure as saz

In [16]:
azure = saz()
azure.asm.get_config()

Search a registered os image

You can choose an os image from the image repository to deploy a virtual machine with the image.
Here, we want to deploy Azure Data Science Core and get_registered_image() helps find an image with a name or a label.


In [17]:
q = azure.asm.get_registered_image(name="Azure-Data-Science-Core")

In [66]:
vars(q)


Out[66]:
{'affinity_group': u'',
 'category': u'User',
 'description': u'{"description":"A special version of HPC Linux is now available as a Windows Azure virtual machine image. Based on OpenSUSE 12.3, this image includes all the packages you need for big data and data science computations including:\\r\\n - iPython\\r\\n - NumPy\\r\\n - SciPy\\r\\n - pandas\\r\\n - SymPy\\r\\n - scikit-learn\\r\\n - scikit-image\\r\\n - StatsModels\\r\\n - matplotlib\\r\\n - PyTables\\r\\n - NetworkX\\r\\n - Cython\\r\\n - NLTK \\r\\n\\r\\nThis image has been specially customized for Windows Azure, so it includes the Windows Azure Agent for Linux and the Azure SDK for Python. Together, these packages give you easy access to Windows Azure\'s storage and queue services directly from iPython.","publisherUrl":"http://vmdepot.msopentech.com/User/Show?user=2464","publisher":"John C Linford","imageUrl":"http://vmdepot.msopentech.com/Vhd/Show?VhdID=2440&version=2471","icons":{"ExtraLarge":"https://vmdepotwestus.blob.core.windows.net/images/2464/0bde9e27-36a6-4355-87b6-6808699424d9_215x215.png","Large":"https://vmdepotwestus.blob.core.windows.net/images/2464/0bde9e27-36a6-4355-87b6-6808699424d9_100x100.png","Small":"https://vmdepotwestus.blob.core.windows.net/images/2464/0bde9e27-36a6-4355-87b6-6808699424d9_45x45.png"}}',
 'eula': u'http://www.hpclinux.com/azure',
 'label': u'Azure-Data-Science-Core',
 'location': u'West Europe',
 'logical_size_in_gb': 12,
 'media_link': u'http://communitytest.blob.core.windows.net/communityimages/community-2464-3ff1336d-e5d8-4485-9d37-fe0634ec18a7-1.vhd',
 'name': u'Azure-Data-Science-Core',
 'os': u'Linux'}

Specify an image to deploy

It seems you found a right image from the repository above. Next, you need to set the image to deploy.


In [7]:
azure.asm.set_image(image=q)

In [8]:
vars(a)


Out[8]:
{'cert': <simpleazure.ext.credentials.Credentials at 0x2f4c550>,
 'certificate_path': '/home/azureuser/.azure/managementCertificate.pem',
 'image': <azure.servicemanagement.OSImage at 0x31a87d0>,
 'image_name': u'Azure-Data-Science-Core',
 'location': 'Central US',
 'name': 'sazvm-41365',
 'os_name': u'Linux',
 'sms': <azure.servicemanagement.servicemanagementservice.ServiceManagementService at 0x2f4c510>,
 'subscription_id': u'a6ca42fe-74c7-43e9-a441-0ab9906441da'}

Region

Some images are restricted to deploy in a certain location due to its availability.
Here, you can see the Azure Data Science Core is only registered in West Europe.


In [9]:
azure.asm.set_location("West Europe")

Ready to deploy

You are all set, now. Simply call the create_vm() or create_cluster() function to deploy the selected image, Azure Data Science Core.


In [9]:
azure.asm.create_vm()

In [66]:
azure.asm.create_cluster(num=5)